package demo01;

import java.awt.Graphics;

public class Sky extends FlyingObject {
	private double y0;

	public Sky() {
		super(0 , 0 , Images.sky , null , null);
		step = 0.8;
		y0 = -height; 
	}

	public void move() {
		y+=step;
		y0+=step;
		
		if(y>=height) {
			y = -height;
		}
		if(y0>=height) {
			y0 = -height;
		}
	}

	public void paint (Graphics g) {
		image.paintIcon(null, g,(int)x,(int)y);
		image.paintIcon(null, g, (int)x, (int)y0);
	}
}
